<!--
  - Copyright (c) 2019.
  - 北京九思金信科技有限公司对该文件内容保留所有权利。
  - 未经许可，不得私自拷贝、传播、发布、引用该文件内容，违者将被追究法律责任。
  -->

<template>
  <transition name="el-zoom-in-top">
    <el-form :model="searchParam" inline style="width: 100%;background: #F4F8F9;margin-bottom: 24px;">
      <el-row>
        <el-col :span="8">
          <el-form-item label="模板名称:" prop="templateName">
            <el-input v-model="searchParam.templateName" class="input-with-select"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <hr style="background-color: #EDEDED;border: none;height: 1px;margin: 0px"/>
      <el-row style="padding:16px 0px">
        <el-col align="right">
          <el-button @click="reset" size="mini" style="margin-right: 24px;">重置</el-button>
          <el-button @click="query" type="primary" size="mini" style="margin-right: 24px;">搜索</el-button>
        </el-col>
      </el-row>
    </el-form>
  </transition>
</template>

<script>
    export default {
        name: "RatingTemplateQueryForm",
      mounted() {
        this.$http.get('/joys-rest/joys-master-data/orgs/default').then(resp => {
          this.orgId = resp.body.orgID
        }, resp => {
          this.$message.error('系统繁忙')
        })
      },
      data() {
        return {
          searchParam: {customerType: [], deptId: null},
          orgId: null
        }
      },
      methods: {
        reset() {
          this.searchParam = {}
        },
        query() {
          this.$emit('query', this.searchParam)
        }
      },
      watch: {
        searchParam(val) {
          this.$emit('change', val)
        }
      }
    }
</script>

<style>
  .input-with-select {
    float: left;
    border-radius: 30px;
  }

  .input-with-select .el-input__inner {
    border-radius: 30px;
  }
</style>
